package com.weng.cloud.service8882.hystrix;

//import com.weng.cloud.hystrix.HystrixService;
//import com.weng.cloud.hystrix.NbaPlayer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @Author: weng
 * @Date: 2022/3/11
 * @Description: com.weng.cloud.service8882.hystrix
 */
@RestController
public class HystrixController
//        implements HystrixService
{


    @GetMapping(value = "/testRestTemplate")
    public String testRestTemplate() throws InterruptedException {
        System.err.println("me too");
        //测试一下配置文件的全局ribbon是否可以影响到restTemplate
        //看起来全局ribbon配置并不会影响到restTemplate
        //呃呃呃。。。。局部也一样呀，看来需要来ioc注入的时候往构造中加参数了...
        //上述所说的指 超时参数的配置 ，重试参数仍然生效
        TimeUnit.SECONDS.sleep(6);
        return "希望一切顺顺滴";
    }

/*    @Override
    public NbaPlayer testFeign(String arg) {
        NbaPlayer result = new NbaPlayer();
        result.setArg(arg);
        result.setName("durant");
        result.setNo(7);
        return result;
    }*/
}
